<link rel="stylesheet" href="resource/css/swiper.min.css" />
<script type="text/javascript" src="resource/js/swiper.min.js" ></script>
<link rel="stylesheet" type="text/css" href="resource/css/myslider.css">
<style>
    .footer-home{display: none;}
</style>
<header>
    <a onclick="javascript:history.back(-1);">
        <i class="iconfont icon-xialalan-copy"></i>
    </a>
    <span><?php echo $output['food_info']['fd_title']; ?></span>
    <!--<a href="#" class="fr"><i class="icshare iconfont icon-fenxiang"></i></a>-->
</header>


    <div class="home-slide swiper-container margin_bot">

        <ul class="slider swiper-wrapper">
            <?php if($output['images']){ ?>
                <?php foreach($output['images'] as $key =>$vo){?>
                    <li class="swiper-slide"><img class="en_pic" src="<?php echo $vo['img_path']; ?>" alt="套餐美食"/></li>
                <?php  }?>
            <?php }else{ ?>
                <img src="resource/images/hotel.jpg" />
            <?php  }?>
        </ul>

    </div>

<div class="contect">
    <div class="scenic_title">
        <h4 class="p-2"><?php echo $output['food_info']['fd_title']; ?></h4>
            <span>
                    <i class="icon_2 iconfont icon-renminbi color_red  price"><?php echo $output['food_info']['price']; ?></i>
                    <i class="off iconfont icon-renminbi fd_market_price"><?php echo $output['food_info']['fd_market_price']; ?></i>
                <span class="soll fr">已售：<b class="color_red sales"><?php echo $output['food_info']['sales']; ?></b></span>
            </span>
    </div>

    <?php if($output['spec_list']){ ?>
        <div class="scenic_title">
            <h4 class="p-2">请选择套餐种类：</h4>
        <?php foreach($output['spec_list'] as $key=>$value){ ?>
            <b class="<?php echo $value['spec_sort']==1?'on':'' ?>"  data-id="<?php echo $value['spec_id'] ?>"><?php echo $value['spec_name'] ?></b>
        <?php } ?>
        </div>
    <?php } ?>

</div>
<div class="room_list">
    <div class="de_title div_padding de_title_bottom">
        套餐内容
    </div>
    <div class="ui-tab">
        <div class="info-shrink-text" id="info-manager-content">
            <?php echo $output['food_info']['fd_content']; ?>
        </div>
        <div class="div_1"><i class="more-text iconfont icon-xialalan"></i></div>
    </div>
</div>
<div class="room_list">
    <div class="de_title div_padding de_title_bottom">
        购买须知
    </div>
    <div class="ui-tab">
        <?php echo $output['food_info']['fd_tips']; ?>
    </div>
</div>
<div class="dining_info">
    <div class="dining_title">餐厅介绍</div>
    <div class="dining_detail ">
        <img src="<?php echo $output['merchant_info']['mc_cover_img'] ?>" alt="餐厅logo"/>
        <div class="dining_name ">
            <a href="index.php?act=food&op=merchant_food&mcid=<?php echo $output['merchant_info']['merchant_id']; ?>">
            <h1><?php echo $output['merchant_info']['mc_shop_name']; ?></h1>
            <p class="cleanfloat starFive sF1">
                <span class="org_star iconfont icon-xingxing"></span>
                <span class="org_star iconfont icon-xingxing"></span>
                <span class="org_star iconfont icon-xingxing"></span>
                <span class="org_star iconfont icon-xingxing"></span>
                <span class="org_star iconfont icon-xingxing"></span>
            </p>
            </a>
            <p class="dining_addr"><i class="iconfont icon-diliweizhi "><?php echo $output['merchant_info']['address']; ?></i></p>
            <i class="iconfont icon-dianhua connect" onclick="window.location.href='tel:<?php echo $output['merchant_info']['service_phone']; ?>'"></i>
        </div>
    </div>
</div>

<div class="user_comment footer_bottom">
    <div class="de_title div_padding de_title_bottom">
        用户评价（<?php echo $output['cot_count'];  ?>）
        <a href="index.php?act=comment&op=index&mc_id=<?php echo $output['food_info']['merchant_id'] ?>&type_id=<?php echo FOOD_MARK;  ?>"> <i class="rotate iconfont icon-xialalan-copy fr"></i></a>
    </div>
    <?php if($output['cmt_list']): ?>

    <div class="assessment_item">
        <?php foreach($output['cmt_list'] as $key=>$value) :?>
            <div class="ass_list">
            <div class="ass_img">
                <img src="<?php echo $value['member_head']; ?>" alt="用户头像">
            </div>
            <div class="ass_info">
                <h1><?php echo $value['member_name']; ?><span class="fr"><?php echo date('Y-m-d',$value['addtime']) ?></span></h1>
                <p class="cleanfloat starFive sF1">
                    <?php for($i=0;$i<$value['all_point'];$i++): ?>
                    <span class="org_star iconfont icon-xingxing"></span>
                    <?php endfor; ?>
                    <b><?php echo $value['all_point']; ?>分</b>
                </p>
                <p class="p-2 p_info"><?php echo $value['content']; ?></p>
                <ul class="food_pic">
                    <?php if($value['pic_1']): ?>
                        <li><img src="<?php echo $value['pic_1']; ?>"></li>
                    <?php endif; ?>
                    <?php if($value['pic_2']): ?>
                        <li><img src="<?php echo $value['pic_2']; ?>"></li>
                    <?php endif; ?>
                    <?php if($value['pic_3']): ?>
                        <li><img src="<?php echo $value['pic_3']; ?>"></li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
            <?php endforeach; ?>
    </div>
    <?php endif; ?>
</div>
<?php if($output['food_info']['is_purchase']==1 ){ ?>
<div class="buy">
    <a  class="hot_line fl">
        <b class="color_red total_price">￥<?php echo $output['food_info']['price']; ?></b>
    </a>

    <a  data-id="<?php echo $output['food_info']['fd_id']; ?>" data-spec-id="<?php echo $output['food_info']['spec_id']; ?>" class="buy_btn fr" >立即购买</a>
</div>
<?php } ?>
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        loop: true,
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });


    $(".scenic_title>b").click(function(){
        var spec_id = $(this).attr("data-id");
        var obj = $(this);
//        $(this).addClass("on").siblings().removeClass("on");
        $.ajax({
            type:'post',
            url:'index.php?act=food&op=get_spec_info',
            data:{spec_id:spec_id},
            dataType:'json',
            success:function(data){
                if(data.tab == 'success') {
                    $(".price").html(data.data.price);
                    $(".total_price").html("￥"+data.data.price);
                    $(".fd_market_price").html(data.data.market_price); $(".sales").html(data.data.sales);
                    $(".buy_btn").attr('data-spec-id',spec_id);
                    obj.addClass("on").siblings().removeClass("on");
                }else{
                    layer.msg(data.info,{icon: 5});
                }
            }
        });
    });


    $(".buy_btn").click(function(){
        var fd_id = $(this).attr("data-id");
        var spec_id = $(this).attr("data-spec-id");
        var forward='index.php?act=food&op=place_info&fd_id='+fd_id+'&spec_id='+spec_id;
        window.location.href =forward;
    });

</script>